Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

389
Visualizações
Discord.js: Error: "Cannot find module 'node:events'" after updating to v13

Today I updated my node version from 12.x to 17.1.0 and my discord.js to 13.3.1. The process of updating was successful but after I run my bot, it outputs the error:

Error: Cannot find module 'node:events'
Require stack:
- /home/runner/rice-v13/node_modules/discord.js/src/client/BaseClient.js
- /home/runner/rice-v13/node_modules/discord.js/src/index.js
- /home/runner/rice-v13/index.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:815:15)
    at Function.Module._load (internal/modules/cjs/loader.js:667:27)
    at Module.require (internal/modules/cjs/loader.js:887:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (/home/runner/rice-v13/node_modules/discord.js/src/client/BaseClient.js:3:22)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
    at Module.require (internal/modules/cjs/loader.js:887:19

Also, I noticed that when I installed a new node version via shell it outputs a warning:

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

I surfed this question on the Internet and only found answers like "You gotta have node version 16 or higher" but I actually have 17.1.0.

about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

I see that you're using replit for your bot. This error happens when your repl node version is not high enough. You can fix that by using the NodeJS v16 Template (https://replit.com/@RoBlockHead/NodeJS-16). Just fork that repl template and move all your code there.

about 4 years ago · Juan Pablo Isaza Relatório

0

Instead of:

const client = new Discord.Client();

Type:

const client = new Discord.Client({ intents: ["DIRECT_MESSAGES", "GUILD_MESSAGES"] });
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda